package repository

import (
	"ai/internal/db/dao"
	"ai/internal/db/models"
)

type UserRepository struct {
	userDAO *dao.UserDAO
}

func NewUserRepository(userDAO *dao.UserDAO) *UserRepository {
	return &UserRepository{userDAO: userDAO}
}

func (repo *UserRepository) RegisterUser(user *models.User) error {
	return repo.userDAO.CreateUser(user)
}

func (repo *UserRepository) FindUserByUsername(username string) (*models.User, error) {
	return repo.userDAO.GetUserByUsername(username)
}
